import request from '@/utils/request';
import { objectToFormData} from '@/utils/form'


export function listForLazyTree(data: any) {
  return request({
    url: '/api/v1/asset/classify/lazy',
    method: 'post',
    data: data
  });
}

export function listForClassify(data: any) {
  return request({
    url: '/api/v1/asset/classify/list',
    method: 'post',
    data: data
  });
}


export function selectTree(data: any) {
  return request({
    url: '/api/v1/project/classify/selectTree',
    method: 'post',
    data: data
  });
}

export function saveForTree(data: any) {
  return request({
    url: '/api/v1/asset/classify/save',
    method: 'post',
    data: data
  });
}

export function deleteForTree(data: any) {
  return request({
    url: '/api/v1/asset/classify/delete',
    method: 'post',
    data: data
  });
}


export function saveForAsset(data: any) {
  return request({
    url: '/api/v1/asset/save',
    method: 'post',
	headers: { "Content-Type": "multipart/form-data" },
    data: objectToFormData(data)
  });
}

export function listForAsset(data: any) {
  return request({
    url: '/api/v1/asset/list',
    method: 'post',
    data: data
  });
}

export function deleteForAsset(data: any) {
  return request({
    url: '/api/v1/asset/delete',
    method: 'post',
    data: data
  });
}
